{extend name="admin@public/layout" /}
{block name="content"}
<div class="page">
  <div class="fixed-bar">
    <div class="item-title"><a class="back" href="{:url('formguide/index',['modelid'=>$modelid])}" title="返回列表"><i class="icon iconfont icon-fanhui"></i></a>
      <div class="subject">
        <h3>表单管理 - 编辑字段</h3>
        <h5>表单新增及修改管理</h5>
      </div>
    </div>
  </div>
  <!-- 操作说明 -->
  <div class="explanation" id="explanation">
    <div class="title" id="checkZoom"><i class="icon iconfont icon-dengpao"></i>
    <h4 alt="提示相关设置操作时应注意的要点" class="itip">操作提示</h4>
    <span id="explanationZoom" alt="收起提示" class="itip"></span>
    </div>
    <ul>
      <li>暂无</li>
    </ul>
  </div>
  <form action="{:url('field/edit')}" method="post" class="form-horizontal">
      <div class="ncap-form-default">
      <div class="title">
          <h3>编辑字段</h3>
      </div>
      <dl class="row">
        <dt class="tit"><em>*</em>字段类型</dt>
        <dd class="opt">
          <select name="formtype">
                <option value=''>请选择字段类型</option>
                {volist name="all_field" id="vo"}
                <option value="{$key}" {eq name="data.formtype" value="$key"}selected{/eq}>{$vo}</option>
                {/volist}

          </select>
        </dd>
      </dl>

      <dl class="row">
        <dt class="tit"><em>*</em>字段名</dt>
        <dd class="opt">
          <input id="field" name="field" value="{$data.field}" type="text" class="input-txt" {if condition="!$isEditField"}disabled{/if}>
          <p class="notic">只能由英文字母、数字和下划线组成，并且仅能字母开头，不以下划线结尾</p>
        </dd>
      </dl>
      <dl class="row">
        <dt class="tit"><em>*</em>字段别名</dt>
        <dd class="opt">
          <input id="name" name="name" value="{$data.name}" type="text" class="input-txt">
          <p class="notic">例如：文章标题</p>
        </dd>
      </dl>
      <dl class="row">
        <dt class="tit">
          <label for="tips">字段提示</label>
        </dt>
        <dd class="opt">
          <textarea name="tips" rows="6" class="tarea">{$data.tips}</textarea>
          <p class="notic">显示在字段别名下方作为表单输入提示</p>
        </dd>
      </dl>
      <dl class="row">
        <dt class="tit">数据校验正则</dt>
        <dd class="opt">
          <input id="validate_rule" name="validate_rule" value="" type="text" class="input-txt">
          <select name="validate_type">
                <option value='' selected>请选择验证方式</option>
                <option value="regex">正则验证</option>
                <option value="function">函数验证</option>
                <option value="unique">唯一验证</option>
                <option value="length">长度验证</option>
                <option value="in">验证在范围内</option>
                <option value="notin">验证不在范围内</option>
                <option value="between">区间验证</option>
                <option value="notbetween">不在区间验证</option>

          </select>
          <p class="notic">系统将通过此正则校验表单提交的数据合法性，如果不想校验数据请留空</p>
        </dd>
      </dl>
      <dl class="row">
        <dt class="tit">
          <label for="tips">数据校验未通过的提示信息</label>
        </dt>
        <dd class="opt">
          <input id="errortips" name="errortips" value="{$data.errortips}" type="text" class="input-txt">
        </dd>
      </dl>
      <dl class="row">
        <dt class="tit">是否显示</dt>
        <dd class="opt">
          <label class="mr10">
            <input name="isadd" type="radio" value="1" {eq name="data.isadd" value="1"} checked{/eq}>是</label>
          <label class="mr10">
            <input name="isadd" type="radio" value="0" {eq name="data.isadd" value="0"} checked{/eq}>否</label>
          <span class="err"></span>
          <p class="notic">基本信息将在添加页面左侧显示</p>
        </dd>
      </dl>
      <div class="clear" style="height: 50px;"></div>
        <input name="modelid" type="hidden" value="{$modelid}">
        <input name="fieldid" type="hidden" value="{$fieldid}">
      <div class="fix-bot"><a href="JavaScript:void(0);" type="submit" class="ajax-post ncap-btn-big ncap-btn-green" target-form="form-horizontal">确认提交</a></div>
      </div>
    </form>
</div>
{/block}
